<div class="usercontrol">
@if (!Auth::check())
<a href="/register" rel='nofollow' style='margin-right:10px'>注册</a><a href="/login">登录</a>
@else
<a href="/post" rel='nofollow' style='margin-right:10px'>发帖</a><a href="/setting">设置</a>
@endif
</div>

@if (Auth::check())
<div class="sider-box">
    <div class="userinfo">
    <div class="btn">
        <table height=10><tr><td height=10></td></tr></table>
        <table>
            <tr>
                <td valign="top" width="48">
                    <a href="/setting" title=><img src="{{ Auth::user()->userinfo->avatar }}" width=48 heigt=48 class="avatar"></a>
                </td>
                <td valign="top" width="20"></td>
                <td valign="center">收藏(<strong><a href="/favorite">{{ Helper::e(Auth::user()->favorite()->count(),0) }}</a></strong>)</td>
                <td valign="top" width="10"></td>
                <td valign="center">提醒(<strong><a href="/notification">{{ Helper::e(Auth::user()->notification()->count(),0) }}</a></strong>)</td>
                <td valign="top" width="10"></td>
                <td valign="center"><a href="/logout">退出</a></td>
            </tr>
        </table>
    </div>
    </div>
</div>
@endif

<div class="sider-box">
    <div class="sider-box-title">管理员面板</div>
    <div class="sider-box-content">
        <div class="btn">
            <a href="">分类管理</a><a href="">网站设置</a><a href="">链接管理</a>
        </div>
    </div>
</div>

<div class="sider-box">
    <div class="sider-box-title">热门帖子</div>
    <div class="hotarticles">
        <ul>
        @foreach (Archive::hot() as $archive)
            <li>{{ HTML::link("/archive/" . $archive->id,$archive->title) }}</li>
        @endforeach
        </ul>
    </div>
</div>

<!-- <div class="sider-box">
    <div class="advert">
        
    </div>
</div> -->

<div class="sider-box">
    <div class="sider-box-title">热门分类</div>
    <div class="sider-box-content">
        <div class="btn">
        @foreach (Categorie::hot() as $cate)
            {{ HTML::link($cate->id,$cate->title) }}
         @endforeach
        </div>
    </div>
</div>
<div class="sider-box">
    <div class="sider-box-title">热门Tag词</div>
    <div class="sider-box-content">
        <div class="btn">
        @foreach (Tag::hot() as $tag)
            <a href="">{{ $tag }}</a>
        @endforeach
        </div>
    </div>
</div>